import { showToast, showDialog } from 'vant'
import 'vant/es/dialog/style'
import 'vant/es/toast/style' 
import "/@/assets/css/message.less"
interface messageParams {
    title?: string,
    message:string,
    confirmText?:string

}

export function Dialog(params:messageParams):Promise<void> {
    return new Promise((resolve,reject) => {
        showDialog({
            title: params.title || "温馨提示",
            message: params.message, // '您的手机号已被占用注册，请更换手机号。'
            theme: 'round-button',
            confirmButtonText:params.confirmText || "好的",
            className:"authDialog"
        }).then(() => {
            resolve()
        })
            .catch((error) => {
                reject(error)
            })
    })
}
export function Toast(str:string) {
    // showToast(str) 
    setTimeout(() => {
        showToast({
            message: str,
            className: 'particulars-detail-popup'
          })
    });
}